*******************************************************************************
******************************REPLICATION FILE 1******************************
*****Kam, Cindy D. and John Sides. 
*****Body Politic: Disgust, Partisanship, and Public Opinion on Viral Outbreaks
*****Journal of Politics
*****This file recreates all figures and tables in the main text
*******************************************************************************

log using "2025-09-01 Replication file 1.txt", replace text 

**# 
*******************************************************************************
**********FIGURE 1**********
* CONCERN
use Body_Politic_All_datasets, clear
foreach v of varlist ebola_concern zika_concern concern_live_1 concern_live_2 concern_live_3 {
	gen `v'r = round(`v'*3)
	forval j = 0/3 {
		recode `v'r (`j'=1)(-99 9 . = .)(else=0), gen(`v'_`j')
}
}	
 
foreach v of varlist ebola_concern zika_concern concern_live_1 concern_live_2 concern_live_3 {
	preserve 
	collapse `v'_0-`v'_3 iweight=weight 
	rename `v'_0 QNotAtAll
	rename `v'_1 QNotToo
	rename `v'_2 QSomewhat
	rename `v'_3 QVery
	gen str DV = "`v'"
	save `v'categories.dta, replace
	restore
}

use ebola_concerncategories, clear
foreach v in zika_concern concern_live_1 concern_live_2 concern_live_3 {
	append using `v'categories.dta
}
gen graphorder = .
replace graphorder = 1 if DV=="ebola_concern"
replace graphorder = 2 if DV=="zika_concern"
replace graphorder = 3 if DV=="concern_live_1"
replace graphorder = 4 if DV=="concern_live_2"
replace graphorder = 5 if DV=="concern_live_3"
gen str20 graphorderstring = "."
replace graphorderstring = "Ebola (2016)" if DV=="ebola_concern"
replace graphorderstring= "Zika (2016)" if DV=="zika_concern"
replace graphorderstring= "COVID (Apr 2020)" if DV=="concern_live_1"
replace graphorderstring= "COVID (Jul 2020)" if DV=="concern_live_2"
replace graphorderstring= "COVID (Jun 2022)" if DV=="concern_live_3"

foreach var of varlist Q* {
 replace `var'=`var'*100
}

#delimit ;
graph hbar QNotAtAll QNotToo QSomewhat QVery, over(graphorderstring, axis(noline) label(labsize(small)) sort(graphorder)) stack
bar(1, fcolor(gs12)) bar(2, fcolor(gs8)) bar(3, fcolor(gs4))  bar(4, fcolor(gs0))  
blabel(bar, pos(center) format(%3.0f) size(small) color(white))
ylab(0 "0%" 25 "25%" 50 "50%" 75 "75%" 100 "100%", nogrid labsize(small))
plotr(ls(none)) graphregion(margin(small))
legend(lab(1 "Not at all") lab(2 "Not too") lab(3 "Somewhat") lab(4 "Very") row(1) symxsize(*.25) size(small) region(lstyle(none))) 
title("Concern about local spread", size(small)) 
name(concernDVs, replace) 
;
#delimit cr
 

* PROTECT AMERICANS 
use Body_Politic_All_datasets, clear
foreach v of varlist ebola_US zika_US protectAmer_1 protectAmer_2 protectAmer_3  {
	gen `v'r = round(`v'*2)
	forval j = 0/2 {
		recode `v'r (`j'=1)(-99 9 . = .)(else=0), gen(`v'_`j')
}
}	

foreach v of varlist ebola_US zika_US protectAmer_1 protectAmer_2 protectAmer_3  {
	preserve 
	collapse `v'_0-`v'_2 iweight=weight 
	rename `v'_0 QMoreThanEnough
	rename `v'_1 QEnough
	rename `v'_2 QNotEnough
	gen str DV = "`v'"
	save `v'categories.dta, replace
	restore
}
 
use ebola_UScategories, clear
foreach v in zika_US protectAmer_1 protectAmer_2 protectAmer_3  {
	append using `v'categories.dta
}
gen graphorder = .
replace graphorder = 1 if DV=="ebola_US"
replace graphorder = 2 if DV=="zika_US"
replace graphorder = 3 if DV=="protectAmer_1"
replace graphorder = 4 if DV=="protectAmer_2"
replace graphorder = 5 if DV=="protectAmer_3"
gen str20 graphorderstring = "."
replace graphorderstring = "Ebola (2016)" if DV=="ebola_US"
replace graphorderstring= "Zika (2016)" if DV=="zika_US"
replace graphorderstring= "COVID (Apr 2020)" if DV=="protectAmer_1"
replace graphorderstring= "COVID (Jul 2020)" if DV=="protectAmer_2"
replace graphorderstring= "COVID (Jun 2022)" if DV=="protectAmer_3"

foreach var of varlist Q* {
 replace `var'=`var'*100
}

#delimit ;
graph hbar QMoreThanEnough QEnough QNotEnough, over(graphorderstring, axis(noline) label(labsize(small)) sort(graphorder)) stack
bar(1, fcolor(gs12)) bar(2, fcolor(gs8)) bar(3, fcolor(gs4))  
blabel(bar, pos(center) format(%3.0f) size(small) color(white))
ylab(0 "0%" 25 "25%" 50 "50%" 75 "75%" 100 "100%", nogrid labsize(small))
plotr(ls(none)) graphregion(margin(small))
legend(lab(1 "More than enough") lab(2 "Enough") lab(3 "Not enough") row(1) symxsize(*.25) size(small) region(lstyle(none))) 
title("Government efforts to protect Americans", size(small)) 
name(protAmerDVs, replace)
;
#delimit cr

* PROTECT ABROAD
use Body_Politic_All_datasets, clear
foreach v of varlist ebola_AF zika_LA fightabroad_1 fightabroad_2 fightabroad_3 {
	gen `v'r = round(`v'*2)
	forval j = 0/2 {
		recode `v'r (`j'=1)(-99 9 . = .)(else=0), gen(`v'_`j')
}
}	

foreach v of varlist ebola_AF zika_LA fightabroad_1 fightabroad_2 fightabroad_3 {
	preserve 
	collapse `v'_0-`v'_2 iweight=weight 
	rename `v'_0 QMoreThanEnough
	rename `v'_1 QEnough
	rename `v'_2 QNotEnough
	gen str DV = "`v'"
	save `v'categories.dta, replace
	restore
}

use ebola_AFcategories, clear
foreach v in zika_LA fightabroad_1 fightabroad_2 fightabroad_3 {
	append using `v'categories.dta
}
gen graphorder = .
replace graphorder = 1 if DV=="ebola_AF"
replace graphorder = 2 if DV=="zika_LA"
replace graphorder = 3 if DV=="fightabroad_1"
replace graphorder = 4 if DV=="fightabroad_2"
replace graphorder = 5 if DV=="fightabroad_3"
gen str20 graphorderstring = "."
replace graphorderstring = "Ebola (2016)" if DV=="ebola_AF"
replace graphorderstring= "Zika (2016)" if DV=="zika_LA"
replace graphorderstring= "COVID (Apr 2020)" if DV=="fightabroad_1"
replace graphorderstring= "COVID (Jul 2020)" if DV=="fightabroad_2"
replace graphorderstring= "COVID (Jun 2022)" if DV=="fightabroad_3"

foreach var of varlist Q* {
 replace `var'=`var'*100
}

#delimit ;
graph hbar QMoreThanEnough QEnough QNotEnough, over(graphorderstring, axis(noline) label(labsize(small)) sort(graphorder)) stack
bar(1, fcolor(gs12)) bar(2, fcolor(gs8)) bar(3, fcolor(gs4))  
blabel(bar, pos(center) format(%3.0f) size(small) color(white))
ylab(0 "0%" 25 "25%" 50 "50%" 75 "75%" 100 "100%", nogrid labsize(small))
plotr(ls(none)) graphregion(margin(small)) 
legend(lab(1 "More than enough") lab(2 "Enough") lab(3 "Not enough") row(1) symxsize(*.25) size(small) region(lstyle(none))) 
title("Government efforts to fight outbreak abroad", size(small)) 
name(fightabroadDVs, replace) 
;
#delimit cr
 

* BORDER POLICY
use Body_Politic_All_datasets, clear
foreach v of varlist ebola_UScit zika_UScit prevent_UScit_1 prevent_UScit_2 prevent_UScit_3 ebola_forcit zika_forcit prevent_forcit_1 prevent_forcit_2 prevent_forcit_3 {
		gen `v'r = round(`v'*2)
		forval j = 0/2 {
		recode `v'r (`j'=1)(-99 9 . = .)(else=0), gen(`v'_`j')
}
}	

foreach v of varlist ebola_UScit zika_UScit prevent_UScit_1 prevent_UScit_2 prevent_UScit_3 ebola_forcit zika_forcit prevent_forcit_1 prevent_forcit_2 prevent_forcit_3 {
	preserve 
	collapse `v'_0-`v'_2 iweight=weight 
	rename `v'_0 QScreen
	rename `v'_1 QQuarantine
	rename `v'_2 QPrevent
	gen str DV = "`v'"
	save `v'categories.dta, replace
	restore
}

use ebola_UScitcategories, clear
foreach v in zika_UScit prevent_UScit_1 prevent_UScit_2 prevent_UScit_3 ebola_forcit zika_forcit prevent_forcit_1 prevent_forcit_2 prevent_forcit_3 {
	append using `v'categories.dta
}
gen graphorder = .
replace graphorder = 1 if DV=="ebola_UScit"
replace graphorder = 2 if DV=="zika_UScit"
replace graphorder = 3 if DV=="prevent_UScit_1"
replace graphorder = 4 if DV=="prevent_UScit_2"
replace graphorder = 5 if DV=="prevent_UScit_3"
replace graphorder = 6 if DV=="ebola_forcit"
replace graphorder = 7 if DV=="zika_forcit"
replace graphorder = 8 if DV=="prevent_forcit_1"
replace graphorder = 9 if DV=="prevent_forcit_2"
replace graphorder = 10 if DV=="prevent_forcit_3"

gen str20 graphorderstring = "."
replace graphorderstring = "Ebola (2016)" if graphorder==1
replace graphorderstring= "Zika (2016)" if graphorder==2
replace graphorderstring= "COVID (Apr 2020)" if graphorder==3
replace graphorderstring= "COVID (Jul 2020)" if graphorder==4
replace graphorderstring= "COVID (Jun 2022)" if graphorder==5
replace graphorderstring = "Ebola (2016)" if graphorder==6
replace graphorderstring= "Zika (2016)" if graphorder==7
replace graphorderstring= "COVID (Apr 2020)" if graphorder==8
replace graphorderstring= "COVID (Jul 2020)" if graphorder==9
replace graphorderstring= "COVID (Jun 2022)" if graphorder==10

foreach var of varlist Q* {
 replace `var'=`var'*100
}

#delimit ;
graph hbar QScreen QQuarantine QPrevent if graphorder<6, over(graphorderstring, axis(noline) label(labsize(small)) sort(graphorder)) stack
bar(1, fcolor(gs12)) bar(2, fcolor(gs8)) bar(3, fcolor(gs4))  
blabel(bar, pos(center) format(%3.0f) size(small) color(white))
ylab(0 "0%" 25 "25%" 50 "50%" 75 "75%" 100 "100%", nogrid labsize(small))
plotr(ls(none)) graphregion(margin(small)) 
legend(lab(1 "Screen") lab(2 "Quarantine") lab(3 "Prevent entry") row(1) symxsize(*.25) size(small) region(lstyle(none))) 
title("Policy for American travelers to US", size(small)) 
name(prevent_UScitDVs, replace)
;
#delimit cr
 
#delimit ; 
graph hbar QScreen QQuarantine QPrevent if graphorder>5, over(graphorderstring, axis(noline) label(labsize(small)) sort(graphorder)) stack
bar(1, fcolor(gs12)) bar(2, fcolor(gs8)) bar(3, fcolor(gs4))  
blabel(bar, pos(center) format(%3.0f) size(small) color(white))
ylab(0 "0%" 25 "25%" 50 "50%" 75 "75%" 100 "100%", nogrid labsize(small))
plotr(ls(none)) graphregion(margin(small)) 
legend(lab(1 "Screen") lab(2 "Quarantine") lab(3 "Prevent entry") row(1) symxsize(*.25) size(small) region(lstyle(none))) 
title("Policy for foreign travelers to US", size(small)) 
name(prevent_forcitDVs, replace) 
;
#delimit cr
graph combine concernDVs protAmerDVs fightabroadDVs prevent_UScitDVs prevent_forcitDVs, ///
  hole(2) row(3) xsize(6.5) ysize(6.5) iscale(*.75) 
graph export Figure1.tif, width(800) height(800) replace


**# 
*******************************************************************************
**********TABLE 1**********
use Body_Politic_All_datasets, clear
svyset [iw=weight]

recode toilet cook choc soda (.51/1=1)(0/.5=0)(else=.), gen(toilet_H cook_H choc_H soda_H)
forval v=1/5{
	preserve 
	keep if dataset==`v'
	sum toilet_H cook_H choc_H soda_H disgust [iw=weight]
	alpha toilet cook choc soda
	restore  
}

**#
*******************************************************************************
**********FIGURE 2**********
svyset [pweight=weight]
tempname memhold
postfile `memhold' str30 DV bdisgust bpid7catdR bideol bfemale bblack bhisp bothrace bage01 sedisgust sepid7catdR seideol sefemale seblack sehisp seothrace seage01 N using "allEZC_coeffs", replace 
foreach var in ebola_concern zika_concern concern_live_1 concern_live_2 concern_live_3 ebola_US zika_US protectAmer_1 protectAmer_2 protectAmer_3 ebola_AF zika_LA fightabroad_1 fightabroad_2 fightabroad_3 ebola_UScit zika_UScit prevent_UScit_1 prevent_UScit_2 prevent_UScit_3 ebola_forcit zika_forcit prevent_forcit_1 prevent_forcit_2 prevent_forcit_3 {
svy: reg `var' disgust pid7catdR ideol female black hisp othrace age01 
est store `var'
post `memhold' ("`var'") (_b[disgust]) (_b[pid7catdR]) (_b[ideol]) (_b[female]) (_b[black]) (_b[hisp]) (_b[othrace]) (_b[age01]) (_se[disgust]) (_se[pid7catdR]) (_se[ideol]) (_se[female]) (_se[black]) (_se[hisp]) (_se[othrace]) (_se[age01]) (e(N))
}
postclose `memhold'

preserve 
use allEZC_coeffs, clear 
gen dvno = _n
recode dvno (1 6 11 16 21=1 "CCES 2016: Ebola")(2 7 12 17 22 = 2 "CCES 2016: Zika")(3 8 13 18 23 = 3 "April 2020 Lucid")(4 9 14 19 24 = 4 "July 2020 Lucid")(5 10 15 20 25 = 5 "2022 YouGov"), gen(EZCwaveno)
gen p25disgust = .
replace p25disgust = .25 if EZCwaveno==1|EZCwaveno==2
replace p25disgust = .375 if EZCwaveno==3
replace p25disgust = .3125 if EZCwaveno==4|EZCwaveno==5
gen p75disgust = .
replace p75disgust = .5625 if EZCwaveno==1|EZCwaveno==2
replace p75disgust = .6875 if EZCwaveno==3
replace p75disgust = .625 if EZCwaveno==4|EZCwaveno==5

gen graphorder = -1*(_n-26)
*creating space between sets of DVs 
replace graphorder = graphorder + 1 if graphorder>=6 
replace graphorder = graphorder + 1 if graphorder>=12
replace graphorder = graphorder + 1 if graphorder>=18
replace graphorder = graphorder + 1 if graphorder>=24

*create the disgust IQR from 25 - 75
gen disgustIQR = bdisgust*(p75disgust-p25disgust)
gen LBdisgustIQR = disgustIQR-1.96*sedisgust*(p75disgust-p25disgust)
gen UBdisgustIQR = disgustIQR+1.96*sedisgust*(p75disgust-p25disgust)

*create the pid IQR from weak DEM to weak GOP 
gen pid7catdIQR = bpid7catdR*(.83-.17)
gen LBpid7catdIQR = pid7catdIQR -1.96*sepid7catd*(.83-.17)
gen UBpid7catdIQR = pid7catdIQR +1.96*sepid7catd*(.83-.17)

#delimit ;
twoway (rspike LBdisgustIQR UBdisgustIQR graphorder if EZCwaveno==1, hor lcolor(gray)) 
 (scatter graphorder disgustIQR if EZCwaveno==1, msymbol(o) mlcolor(gray) mfcolor(white))
 (rspike LBdisgustIQR UBdisgustIQR graphorder if EZCwaveno==2, hor lcolor(gray)) 
 (scatter graphorder disgustIQR if EZCwaveno==2, msymbol(o) mcolor(gray)) 
 (rspike LBdisgustIQR UBdisgustIQR graphorder if EZCwaveno==3, hor lcolor(black)) 
 (scatter graphorder disgustIQR if EZCwaveno==3, msymbol(o) mcolor(black) mfcolor(white)) 
 (rspike LBdisgustIQR UBdisgustIQR graphorder if EZCwaveno==4, hor lcolor(black))
 (scatter graphorder disgustIQR if EZCwaveno==4, msymbol(o) mcolor(black))
 (rspike LBdisgustIQR UBdisgustIQR graphorder if EZCwaveno==5, hor lcolor(black))
 (scatter graphorder disgustIQR if EZCwaveno==5, msymbol(o) mcolor(black) mfcolor(gray)),
 leg(off) plotr(ls(none) margin(r+3)) ysc(nofextend noline) xsc(nofextend) 
  ytitle("") xlab(, labsize(small)) xtitle("Shift in opinion", size(small)) 
  ylab(5 "Keep out foreign citizens" 11 "Keep out US citizens"  17 "Not doing enough abroad" 23 "Not doing enough in US" 29 "Level of concern", angle(0) notick labsize(small)) 
  xline(0, lcolor(gray) lpattern(dot)) title("Relationship with disgust sensitivity" "(shift from 25th to 75th percentile)" " ", size(small)) 
  ysize(6) text(29 .12 "Ebola", size(vsmall) place(e)) 
  text(28 .12 "Zika", size(vsmall) place(e)) 
  text(27 .14 "COVID (April 2020)", size(vsmall) place(e)) 
  text(26 .15 "COVID (July 2020)", size(vsmall) place(e)) 
  text(25 .16 "COVID (June 2022)", size(vsmall) place(e)) 
  name(disgust, replace)
;
#delimit cr

#delimit ;
twoway (rspike LBpid7catdIQR UBpid7catdIQR graphorder if EZCwaveno==1, hor lcolor(gray)) 
(scatter graphorder pid7catdIQR if EZCwaveno==1, msymbol(o) mlcolor(gray) mfcolor(white)) 
(rspike LBpid7catdIQR UBpid7catdIQR graphorder if EZCwaveno==2, hor lcolor(gray)) 
(scatter graphorder pid7catdIQR if EZCwaveno==2, msymbol(o) mcolor(gray)) 
(rspike LBpid7catdIQR UBpid7catdIQR graphorder if EZCwaveno==3, hor lcolor(black)) 
(scatter graphorder pid7catdIQR if EZCwaveno==3, msymbol(o) mcolor(black) mfcolor(white)) 
(rspike LBpid7catdIQR UBpid7catdIQR graphorder if EZCwaveno==4, hor lcolor(black))
(scatter graphorder pid7catdIQR if EZCwaveno==4, msymbol(o) mcolor(black))
(rspike LBpid7catdIQR UBpid7catdIQR graphorder if EZCwaveno==5, hor lcolor(black))
(scatter graphorder pid7catdIQR if EZCwaveno==5, msymbol(o) mcolor(black) mfcolor(gray)), 
leg(off) plotr(ls(none) margin(r+3)) 
ysc(nofextend off) ylab(5 "Keep out foreign citizens" 11 "Keep out US citizens"  17 "Not doing enough abroad" 23 "Not doing enough in US" 29 "Level of concern", angle(0) notick labsize(small)) 
xsc(nofextend) ytitle("") xlab(, labsize(small)) xtitle("Shift in opinion", size(small))
xline(0, lcolor(gray) lpattern(dot)) title("Relationship with PID" "(shift from weak Rep to weak Dem)" " ", size(small)) 
ysize(6) fxsize(50)
text(29 .15 "Ebola", size(vsmall) place(e)) text(28 .12 "Zika", size(vsmall) place(e)) text(27 .1 "COVID (April 2020)", size(vsmall) place(e)) text(26 .11 "COVID (July 2020)", size(vsmall) place(e)) text(25 .24 "COVID (June 2022)", size(vsmall) place(e)) 
name(pid7, replace)
;
#delimit cr

graph combine disgust pid7, row(1) xcommon
graph export Figure2.tif, width(1200) height(800) replace
restore

**#
*******************************************************************************
**********FIGURE 3**********
use Body_Politic_All_datasets, clear 
svyset [pweight=weight]

*Create a dataset with the weighted mean 
tempname memhold
postfile `memhold' str30 DV weightedmean using "C19_persbeh_means", replace 
foreach var in per_wash per_cancel_travel per_stock_goods per_novisit per_stayhome per_nohospital per_avoid_public per_work_home have_wornmask avoided_socwdist avoided_socwodist avoided_travel have_wornmask3 have_vaccinated have_booster {
	svy: reg `var' 
post `memhold' ("`var'") (_b[_cons]) 
}
postclose `memhold'

tempname memhold
postfile `memhold' str30 DV bdisgust bpid7catdR bideol bfemale bblack bhisp bothrace bage01 sedisgust sepid7catdR seideol sefemale seblack sehisp seothrace seage01 N using "C19_persbeh_coeffs", replace 
foreach var of varlist per_wash per_cancel_travel per_stock_goods per_novisit per_stayhome per_nohospital per_avoid_public per_work_home have_wornmask avoided_socwdist avoided_socwodist avoided_travel have_wornmask3 have_vaccinated have_booster index_pers_1 index_pers_2r {
 svy: reg `var' disgust pid7catdR ideol female black hisp othrace age01 
est store `var'
post `memhold' ("`var'") (_b[disgust]) (_b[pid7catdR]) (_b[ideol]) (_b[female]) (_b[black]) (_b[hisp]) (_b[othrace]) (_b[age01]) (_se[disgust]) (_se[pid7catdR]) (_se[ideol]) (_se[female]) (_se[black]) (_se[hisp]) (_se[othrace]) (_se[age01]) (e(N))
}
postclose `memhold'
 
gen C19_perswave = .
replace C19_perswave = 2 if nationscape1==1
replace C19_perswave = 3 if nationscape2==1
replace C19_perswave = 4 if yougov==1

lab def C19_perswave 1"CCES 2016" 2"Lucid April 2020" 3"Lucid July 2020" 4"YouGov May 2022"
lab val C19_perswave C19_perswave 

forval j =2(1)4 {
egen p25disgust_`j' = pctile(disgust) if C19_perswave==`j', p(25) 
egen p75disgust_`j' = pctile(disgust) if C19_perswave==`j', p(75) 
}

sum p25* p75* 

//*Create Figures using the saved coefficients*/
preserve 
use C19_persbeh_coeffs, clear 
gen dvno = _n
merge 1:1 DV using C19_persbeh_means
recode dvno (1/8 16=1 "April 2020 Lucid")(9/12 17= 2 "July 2020 Lucid")(13/15 = 3 "2022 YouGov"), gen(C19_perswaveno)
sort C19_perswaveno weightedmean 
recode dvno (1=18)(7=17)(4=16)(5=15)(3=14)(6=13)(2=12)(8=11)(16=10)(9=8)(10=5)(12=6)(11=7)(17=4)(14=2)(15=1)(13=0), gen(graphorder)
#delimit ;
label define graphorder
18 "Washed hands more"
17 "Avoided events"
16 "Avoided visiting"
15 "Stayed home"
14 "Stocked goods"
13 "Avoided hospital"
12 "Cancelled travel"
11 "Worked from home"
10 "Index of behaviors"
9 " "
8 "Have worn mask"
7 "Avoided socializing without distancing"
6 "Avoided non-essential travel"
5 "Avoided socializing while distancing"
4 "Index of behaviors"
3 " "
2 "Got at least 1 vaccine shot"
1 "Got booster shot"
0 "Have worn mask"
, modify
;
#delimit cr
label values graphorder graphorder

//first graph, of means
gen pctmean = weightedmean*100
format pctmean %9.0f 

#delimit
twoway (scatter graphorder pctmean if C19_perswaveno==1, msymbol(o) mcolor(black) mfcolor(white) mlabel(pctmean)  mlabsize(small))
(scatter graphorder pctmean if C19_perswaveno==2, msymbol(o) mcolor(black) mlabel(pctmean) mlabsize(small))
(scatter graphorder pctmean if C19_perswaveno==3, msymbol(o) mcolor(black) mcolor(gray) mlabel(pctmean) mlabsize(small)),
 leg(off) plotr(ls(none)) ysc(nofextend) xsc(nofextend) ysc(nofextend noline) xsc(nofextend) ytitle("") xlab(0 "0%" 50 "50%" 100 "100%", labsize(small)) 
 xtitle(" ", size(small)) title("Percent reporting" "each behavior" , size(small)) xtitle(" ") 
 yline(3 9, lcolor(gray) lpattern(dash)) 
 ylab(0(1)18, angle(0) val labsize(small) notick) 
 text(14 30 "April" "2020", size(small)) 
 text(7  30 "July" "2020", size(small)) 
 text(1.5 30 "June" "2022",  size(small)) name(pers_means, replace) 
 ysize(6)
;
#delimit cr
* xsize(3) ysize(4)

gen p25disgust = .
replace p25disgust = .25 if C19_perswaveno==1|C19_perswaveno==2
replace p25disgust = .375 if C19_perswaveno==3
replace p25disgust = .3125 if C19_perswaveno==4|C19_perswaveno==5
gen p75disgust = .
replace p75disgust = .5625 if C19_perswaveno==1|C19_perswaveno==2
replace p75disgust = .6875 if C19_perswaveno==3
replace p75disgust = .625 if C19_perswaveno==4|C19_perswaveno==5

*create the disgust IQR from 25 - 75
gen disgustIQR = bdisgust*(p75disgust-p25disgust)
gen LBdisgustIQR = disgustIQR-1.96*sedisgust*(p75disgust-p25disgust)
gen UBdisgustIQR = disgustIQR+1.96*sedisgust*(p75disgust-p25disgust)

*create the pid IQR from weak DEM to weak GOP 
gen pid7catdIQR = bpid7catdR*(.83-.17)
gen LBpid7catdIQR = pid7catdIQR -1.96*sepid7catd*(.83-.17)
gen UBpid7catdIQR = pid7catdIQR +1.96*sepid7catd*(.83-.17)

#delimit ;
twoway (rspike LBdisgustIQR UBdisgustIQR graphorder if C19_perswaveno==1, hor lcolor(black)) 
(scatter graphorder disgustIQR if C19_perswaveno==1, msymbol(o) mcolor(black) mfcolor(white)) 
(rspike LBdisgustIQR UBdisgustIQR graphorder if C19_perswaveno==2, hor lcolor(black))
(scatter graphorder disgustIQR if C19_perswaveno==2, msymbol(o) mcolor(black))
(rspike LBdisgustIQR UBdisgustIQR graphorder if C19_perswaveno==3, hor lcolor(black))
(scatter graphorder disgustIQR if C19_perswaveno==3, msymbol(o) mcolor(black) mcolor(gray)), 
leg(off) plotr(ls(none)) ysc(nofextend) xsc(nofextend) ysc(nofextend noline) xsc(r(0 .33) nofextend) 
ytitle(" ") xlab(0(.1).3, labsize(small)) xtitle("Shift in behavior", size(small)) 
yline(3 9, lcolor(gray) lpattern(dash)) ylab(none) xline(0, lcolor(gray) lpattern(dot)) 
title("Relationship with disgust sensitivity" "(shift from 25th to 75th percentile)", size(small)) 
name(disgust, replace) ysize(6) fxsize(30)
;
#delimit cr
* xsize(3) ysize(4) 

#delimit ;
twoway (rspike LBpid7catdIQR UBpid7catdIQR graphorder if C19_perswaveno==1, hor lcolor(black)) 
(scatter graphorder pid7catdIQR if C19_perswaveno==1, msymbol(o) mcolor(black) mfcolor(white)) 
(rspike LBpid7catdIQR UBpid7catdIQR graphorder if C19_perswaveno==2, hor lcolor(black))
(scatter graphorder pid7catdIQR if C19_perswaveno==2, msymbol(o) mcolor(black))
(rspike LBpid7catdIQR UBpid7catdIQR graphorder if C19_perswaveno==3, hor lcolor(black))
(scatter graphorder pid7catdIQR if C19_perswaveno==3, msymbol(o) mcolor(black) mcolor(gray)), 
leg(off) plotr(ls(none)) ysc(nofextend) xsc(nofextend) ysc(nofextend noline) xsc(r(0 .33) nofextend) 
ytitle("") xlab(0(.1).3, labsize(small)) xtitle("Shift in behavior", size(small)) 
yline(3 9, lcolor(gray) lpattern(dash)) ylab(none) xline(0, lcolor(gray) lpattern(dot)) 
title("Relationship with PID" "(shift from weak Rep to weak Dem)", size(small)) 
name(pid7catd, replace) ysize(6) fxsize(30)
;
#delimit cr
*  xsize(3) ysize(4)

graph combine pers_means disgust pid7catd, row(1) 
graph export Figure3.tif, width(1200) height(800) replace 
restore 

**#
*******************************************************************************
**********FIGURE 4**********
use Body_Politic_All_datasets, clear 
svyset [pweight=weight]

preserve
tempname memhold
postfile `memhold' str30 DV weightedmean using "C19_reluctance_means", replace
foreach var in return_restaurant_1 return_sports_1 return_child_school_1 return_concert_1 return_fly_1 return_mall_1 return_transit_1 return_movies_1 return_dinner_1 return_dentist_1 return_haircut_1 return_funeral_1 return_wedding_1 return_church_1 return_school_self_1 disc_restaurant disc_takeout disc_grocerystore disc_grocerydelivery disc_friendsover disc_bar return_restaurant_3 return_sports_3 return_concert_3 return_fly_3 return_mall_3  return_transit_3 return_movies_3 return_dinner_3 return_dentist_3 return_haircut_3 return_church_3  {
	recode `var' (0/.99=0)(1=1)(else=.)
	svy: reg `var'
post `memhold' ("`var'") (_b[_cons]) 
}
postclose `memhold'
restore 

*Running the model and saving results 
tempname memhold
postfile `memhold' str30 DV bdisgust bpid7catdR bideol bfemale bblack bhisp bothrace bage01 sedisgust sepid7catdR seideol sefemale seblack sehisp seothrace seage01 N using "C19_reluctance_coeffs", replace 
foreach var of varlist return_restaurant_1 return_sports_1 return_child_school_1 return_concert_1 return_fly_1 return_mall_1 return_transit_1 return_movies_1 return_dinner_1 return_dentist_1 return_haircut_1 return_funeral_1 return_wedding_1 return_church_1 return_school_self_1 disc_restaurant disc_takeout disc_grocerystore disc_grocerydelivery disc_friendsover disc_bar return_restaurant_3 return_sports_3 return_concert_3  return_fly_3 return_mall_3 return_transit_3 return_movies_3 return_dinner_3 return_dentist_3 return_haircut_3 return_church_3 index_return_1  index_discomfort index_return_3{
 svy: reg `var' disgust pid7catdR ideol female black hisp othrace age01 
est store `var'
post `memhold' ("`var'") (_b[disgust]) (_b[pid7catdR]) (_b[ideol]) (_b[female]) (_b[black]) (_b[hisp]) (_b[othrace]) (_b[age01]) (_se[disgust]) (_se[pid7catdR]) (_se[ideol]) (_se[female]) (_se[black]) (_se[hisp]) (_se[othrace]) (_se[age01]) (e(N))
}
postclose `memhold'
 
preserve 
use C19_reluctance_coeffs, clear 
gen dvno = _n
merge 1:1 DV using C19_reluctance_means
gen dvnolabel = dvno
#delimit ;
label define dvno
1"Eat at a restaurant 1"
2"Attend a pro sporting event 1"
3"Send child to school 1"
4"Go to a stadium concert 1"
5"Fly on a plane 1"
6"Go to the mall 1"
7"Ride public transit 1"
8"Go to the movies 1"
9"Eat at a friend's house 1"
10"Go to the dentist 1"
11"Get a haircut 1"
12"Attend a funeral 1"
13"Attend a wedding 1"
14"Go to church 1"
15"Return to school yourself 1"
16"Eat at a restaurant 2"
17"Get takeout delivered 2"
18"Go to grocery store 2"
19"Get groceries delivered 2"
20"Have friends over for dinner 2"
21"Go to a bar 2"
22"Eat at a restaurant 3"
23"Attend a pro sporting event 3"
24"Go to a stadium concert 3"
25"Fly on a plane 3"
26"Go to the mall 3"
27"Ride public transit 3"
28"Go to the movies 3"
29"Eat at a friend's house 3"
30"Go to the dentist 3"
31"Get a haircut 3"
32"Go to church 3"
33"Index: Return 1"
34"Index: Discomfort 2"
35"Index: Return 3"
, modify
;
#delimit cr
label values dvno dvno

recode dvno (1/15 33=1 "July 2020 Lucid")(16/21 34= 2 "2020 CES")(22/32 35=3 "2022 YouGov"), gen(C19_relwaveno)
recode dvno (18=0) (17=1) (19=2) (20=3) (16=4) (21=5)   (22=12) (10=9) (29=8) (9=8) (30=9) (26=13) (11=11) (12=10) (31=11) (1=12) (6=13) (14=18) (13=14) (3=15) (15=16) (28=17) (5=20) (7=19) (8=17) (32=18) (2=22) (27=19) (25=20) (4=21) (24=21) (23=22)(33 35=7)(34=-1), gen(graphorder)

#delimit ;
label define graphorder
-1 "Index: Discomfort"
0 "Go to grocery store"
1 "Get takeout delivered"
2 "Get groceries delivered"
3 "Have friends over for dinner"
4 "Eat at a restaurant"
5 "Go to a bar"
6 " "
7 "Index: Reluctance"
8 "Eat at a friend's house"
9 "Go to the dentist"
10 "Attend a funeral"
11 "Get a haircut"
12 "Eat at a restaurant"
13 "Go to the mall"
14 "Attend a wedding"
15 "Send child to school"
16 "Return to school yourself"
17 "Go to the movies"
18 "Go to church"
19 "Ride public transit"
20 "Fly on a plane"
21 "Go to a stadium concert"
22 "Attend a pro sporting event"
, modify 
;
#delimit cr
label values graphorder graphorder

//first graph, of means
gen pctmean = weightedmean*100
format pctmean %9.0f 

//create five series to toggle the direction of the marker labels
gen greaterin2022 = 0
replace greaterin2022 = 1 if graphorder==9|graphorder==11|graphorder==18|graphorder==19|graphorder==20|graphorder==21|graphorder==22

#delimit ;
twoway (scatter graphorder pctmean if C19_relwaveno==1 & greaterin2022==1, msymbol(o) mcolor(black) mfcolor(black) mlabel(pctmean) mlabp(9))
(scatter graphorder pctmean if C19_relwaveno==1 & greaterin2022==0, msymbol(o) mcolor(black) mfcolor(black) mlabel(pctmean) mlabp(3))
(scatter graphorder pctmean if C19_relwaveno==2, msymbol(sh) mcolor(black) mfcolor(white) mlabel(pctmean))
(scatter graphorder pctmean if C19_relwaveno==3 & greaterin2022==1, msymbol(o) mcolor(gray) mlabel(pctmean) mlabp(3)) 
(scatter graphorder pctmean if C19_relwaveno==3 & greaterin2022==0, msymbol(o) mcolor(gray) mlabel(pctmean) mlabp(9)),
leg(off) plotr(ls(none)) ysc(nofextend) xsc(nofextend) ysc(nofextend noline) 
xsc(r(-.05(.05).2)) ytitle("") xlab(0 "0%" 25 "25%" 50 "50%" 75 "75%" 100 "100%", labsize(small)) 
xtitle(" ", size(small)) title("Reluctance and discomfort" "with activities", size(small)) 
yline(6, lcolor(gray) lpattern(dash)) ylab(-1(1)22, angle(0) val labsize(small) notick) 
text(21.5 25 "July" "2020", size(small) place(w)) 
text(21.5 75 "June" "2022", place(e) color(gray) size(small)) 
text(4.5 75 "Fall" "2020", place(e) size(small)) 
text(14 53 "% Definitely" "would not", place(e) size(small)) 
text(1.5 63 "% Extremely" "uncomfortable", size(small)) 
ysize(6) name(reluctancemeans, replace) graphregion(margin(l+30)) xsize(3)
;
#delimit cr


gen p25disgust = .
replace p25disgust = .3125 if C19_relwaveno==1|C19_relwaveno==2|C19_relwaveno==3
gen p75disgust = .
replace p75disgust = .6875 if C19_relwaveno==1
replace p75disgust = .625 if C19_relwaveno==2|C19_relwaveno==3

*create the disgust IQR from 25 - 75
gen disgustIQR = bdisgust*(p75disgust-p25disgust)
gen LBdisgustIQR = disgustIQR-1.96*sedisgust*(p75disgust-p25disgust)
gen UBdisgustIQR = disgustIQR+1.96*sedisgust*(p75disgust-p25disgust)

*create the pid IQR from weak DEM to weak GOP 
gen pid7catdIQR = bpid7catdR*(.83-.17)
gen LBpid7catdIQR = pid7catdIQR -1.96*sepid7catd*(.83-.17)
gen UBpid7catdIQR = pid7catdIQR +1.96*sepid7catd*(.83-.17)

#delimit ;
twoway (rspike LBdisgustIQR UBdisgustIQR graphorder if C19_relwaveno==1, hor lcolor(black))
(scatter graphorder disgustIQR if C19_relwaveno==1, msymbol(o) mcolor(black) mfcolor(black))
(rspike LBdisgustIQR UBdisgustIQR graphorder if C19_relwaveno==2, hor lcolor(black))
(scatter graphorder disgustIQR if C19_relwaveno==2, msymbol(s) mcolor(black) mfcolor(white))
(rspike LBdisgustIQR UBdisgustIQR graphorder if C19_relwaveno==3, hor lcolor(gray))
(scatter graphorder disgustIQR if C19_relwaveno==3, msymbol(o) mcolor(gray) mfcolor(gray)),
 leg(off) plotr(ls(none) margin(r+3)) ysc(nofextend noline) xsc(r(-.05(.05).2) nofextend) 
 ytitle("") xlab(-.05(.05).2, labsize(small)) xtitle("Shift in reluctance", size(small)) 
 yline(6, lcolor(gray) lpattern(dash)) ylab(none) xline(0, lcolor(gray) lpattern(dot)) 
 title("Relationship with disgust sensitivity" "(shift from 25th to 75th percentile)", size(small)) 
 fxsize(30) ysize(6) name(disgust, replace) xsize(3)
;
#delimit cr


#delimit
twoway (rspike LBpid7catdIQR UBpid7catdIQR graphorder if C19_relwaveno==1, hor lcolor(black))
(scatter graphorder pid7catdIQR if C19_relwaveno==1, msymbol(o) mcolor(black) mfcolor(black)) 
(rspike LBpid7catdIQR UBpid7catdIQR graphorder if C19_relwaveno==2, hor lcolor(black))
(scatter graphorder pid7catdIQR if C19_relwaveno==2, msymbol(s) mcolor(black) mfcolor(white)) 
(rspike LBpid7catdIQR UBpid7catdIQR graphorder if C19_relwaveno==3, hor lcolor(gray))
(scatter graphorder pid7catdIQR if C19_relwaveno==3, msymbol(o) mcolor(gray) mfcolor(gray)),
 leg(off) plotr(ls(none) margin(r+3)) ysc(nofextend noline) xsc(nofextend) ytitle("") 
 xlab(-.05(.05).2, labsize(small)) xtitle("Shift in reluctance", size(small)) 
 yline(6, lcolor(gray) lpattern(dash)) ylab(none) xline(0, lcolor(gray) lpattern(dot)) 
 title("Relationship with PID" "(shift from weak Rep to weak Dem)", size(small)) 
 fxsize(30) ysize(6) name(pid7catd, replace) xsize(3)
;
#delimit cr

graph combine reluctancemeans disgust pid7catd , row(1) xsize(10) ysize(8)
graph export Figure4.tif, width(1000) height(800) replace
restore 

**#
*******************************************************************************
**********FIGURE 5**********
use Body_Politic_All_datasets, clear 
gen C19_policies=.
replace C19_policies=1 if nationscape1==1
replace C19_policies=2 if nationscape2==1
replace C19_policies=3 if yougov==1

*Create a dataset with the weighted % indicating % strongly support 
preserve
tempname memhold
postfile `memhold' str30 DV weightedmean using "C19_policy_means", replace
foreach var in loc_cancel_meet_1 loc_close_biz_1 loc_close_schools_1 loc_work_home_1 loc_restrict_noness_1 loc_fevertest_1 loc_cancel_meet_2 loc_close_biz_2 loc_close_schools_2 loc_work_home_2 loc_restrict_noness_2 loc_fevertest_2 loc_req_mask_2 loc_quar_high_2 K12masks K12vax masks_plane health_vax biz_vax {
	recode `var' (0/.99=0)(1=1)(else=.)
	svy: reg `var'
post `memhold' ("`var'") (_b[_cons]) 
}
postclose `memhold'
restore 

svyset [pweight=weight]
tempname memhold
postfile `memhold' str30 DV bdisgust bpid7catdR bideol bfemale bblack bhisp bothrace bage01 sedisgust sepid7catdR seideol sefemale seblack sehisp seothrace seage01 N using "C19_policy_coeffs", replace 
foreach var of varlist loc_cancel_meet_1 loc_close_biz_1 loc_close_schools_1 loc_work_home_1 loc_restrict_noness_1 loc_fevertest_1 loc_cancel_meet_2 loc_close_biz_2 loc_close_schools_2 loc_work_home_2 loc_restrict_noness_2 loc_fevertest_2 loc_req_mask_2 loc_quar_high_2 K12masks K12vax masks_plane health_vax biz_vax index_pol_1 index_pol_2 index_pol_3  {
 svy: reg `var' disgust pid7catdR ideol female black hisp othrace age01 
est store `var'
post `memhold' ("`var'") (_b[disgust]) (_b[pid7catdR]) (_b[ideol]) (_b[female]) (_b[black]) (_b[hisp]) (_b[othrace]) (_b[age01]) (_se[disgust]) (_se[pid7catdR]) (_se[ideol]) (_se[female]) (_se[black]) (_se[hisp]) (_se[othrace]) (_se[age01]) (e(N))
}
postclose `memhold'
 
preserve 
use C19_policy_coeffs, clear 
gen dvno = _n
merge 1:1 DV using C19_policy_means
gen dvnolabel = dvno
#delimit ;
label define dvno
1 "Cancel meetings 1"
2 "Close businesses 1"
3 "Close schools 1"
4 "Require work from home 1"
5 "Restrict travel 1"
6 "Test for fever 1"
7 "Cancel meetings 2"
8 "Close businesses 2"
9 "Close schools 2"
10 "Require work from home 2"
11 "Restrict travel 2"
12 "Test for fever 2"
13 "Require masks 2"
14 "Quarantine travelers 2"
15 "Require masks in schools 3"
16 "Require vaccine in schools 3"
17 "Require masks on planes 3"
18 "Require vaccine for health workers 3"
19 "Require vaccine for large businesses 3"
20 "Index: Policies 1"
21 "Index: Policies 2"
22 "Index: Policies 3"
, modify
;
#delimit cr
label values dvno dvno

*create groups of DVs to number the waves 
recode dvno (1/6 20 =1 "April 2020 Lucid")(7/14 21= 2 "July 2020 Lucid")(15/19 22=3 "2022 YouGov"), gen(C19_polwaveno)

*want to order the DVs by percentage, combining Nationscape in top panel and then Yougov below
recode dvno (22=0)(15=1)(16=2)(19=3)(17=4)(18=5)(21=7)(20=7)(12=8)(6=8)(14=9)(13=10)(11=11)(5=11)(8=12)(2=12)(9=13)(3=13)(7=14)(1=14)(10=15)(4=15), gen(graphorder)

#delimit ;
label define graphorder
0 "Index: Policies"
1 "Require masks in schools"
2 "Require vaccine in schools"
3 "Require vaccine for large businesses"
4 "Require masks on planes"
5 "Require vaccine for health workers"
6 " "
7 "Index: Policies"
8 "Test for fever"
9 "Quarantine travelers"
10 "Require masks"
11 "Restrict travel"
12 "Close businesses"
13 "Close schools"
14 "Cancel meetings"
15 "Require work from home" 
, modify
;
#delimit cr
label values graphorder graphorder

//first graph, of means
gen pctmean = weightedmean*100
format pctmean %9.0f 

#delimit ;
twoway (scatter graphorder pctmean if C19_polwaveno==1, msymbol(o) mcolor(black) mfcolor(white) mlabel(pctmean)) 
(scatter graphorder pctmean if C19_polwaveno==2, msymbol(o) mcolor(black) mlabel(pctmean) mlabp(9))
(scatter graphorder pctmean if C19_polwaveno==3, msymbol(o) mcolor(gray) mlabel(pctmean)), 
leg(off) plotr(ls(none)) ysc(nofextend) xsc(nofextend) ysc(nofextend noline) xsc(nofextend) ytitle("") 
xlab(0 "0%" 50 "50%" 100 "100%", labsize(small)) 
xtitle(" ", size(small)) title("Percent strongly" "support policy" , size(small)) 
yline(6, lcolor(gray) lpattern(dash)) ylab(0(1)15, angle(0) val labsize(small) notick) 
text(14.5 95 "April" "2020", size(small) place(e))
text(14.5 35 "July" "2020", place(w) size(small)) 
text(5 75 "June" "2022", place(e) color(gray) size(small)) ysize(6) 
name(policy_means, replace) 
;
#delimit cr

gen p25disgust = .
replace p25disgust = .37 if C19_polwaveno==1
replace p25disgust= .3125 if C19_polwaveno==2|C19_polwaveno==3
gen p75disgust = .
replace p75disgust = .6875 if C19_polwaveno==1|C19_polwaveno==2
replace p75disgust = .625 if C19_polwaveno==3

*create the disgust IQR from 25 - 75
gen disgustIQR = bdisgust*(p75disgust-p25disgust)
gen LBdisgustIQR = disgustIQR-1.96*sedisgust*(p75disgust-p25disgust)
gen UBdisgustIQR = disgustIQR+1.96*sedisgust*(p75disgust-p25disgust)

*create the pid IQR from weak DEM to weak GOP 
gen pid7catdIQR = bpid7catdR*(.83-.17)
gen LBpid7catdIQR = pid7catdIQR -1.96*sepid7catd*(.83-.17)
gen UBpid7catdIQR = pid7catdIQR +1.96*sepid7catd*(.83-.17)

#delimit ;
twoway (rspike LBdisgustIQR UBdisgustIQR graphorder if C19_polwaveno==1, hor msymbol(o) mcolor(black)) 
(scatter graphorder disgustIQR if C19_polwaveno==1, msymbol(o) mcolor(black) mfcolor(white)) 
(rspike LBdisgustIQR UBdisgustIQR graphorder if C19_polwaveno==2, hor msymbol(o) mcolor(black)) 
(scatter graphorder disgustIQR if C19_polwaveno==2, msymbol(o) mcolor(black)) 
(rspike LBdisgustIQR UBdisgustIQR graphorder if C19_polwaveno==3, hor msymbol(o) mcolor(black)) 
(scatter graphorder disgustIQR if C19_polwaveno==3, msymbol(o) mcolor(gray) mfcolor(gray)), 
leg(off) plotr(ls(none)) ysc(nofextend) xsc(nofextend) ysc(nofextend noline) xsc(r(0(.2).4) nofextend) ytitle("") 
xlab(0(.2).4, labsize(small)) xtitle("Shift in support", size(small)) 
yline(6, lcolor(gray) lpattern(dash)) ylab(none) xline(0, lcolor(gray) lpattern(dot)) 
title("Relationship with disgust sensitivity" "(shift from 25th to 75th percentile)", size(small)) 
fxsize(27) ysize(6) name(disgust, replace)  
;
#delimit cr

#delimit ; 
twoway (rspike LBpid7catdIQR UBpid7catdIQR graphorder if C19_polwaveno==1, hor msymbol(o) mcolor(black)) 
(scatter graphorder pid7catdIQR if C19_polwaveno==1, msymbol(o) mcolor(black) mfcolor(white)) 
(rspike LBpid7catdIQR UBpid7catdIQR graphorder if C19_polwaveno==2, hor msymbol(o) mcolor(black)) (scatter graphorder pid7catdIQR if C19_polwaveno==2, msymbol(o) mcolor(black)) (rspike LBpid7catdIQR UBpid7catdIQR graphorder if C19_polwaveno==3, hor msymbol(o) mcolor(black)) 
(scatter graphorder pid7catdIQR if C19_polwaveno==3, msymbol(o) mcolor(gray) mfcolor(gray)), 
leg(off) plotr(ls(none) margin(r+3)) ysc(nofextend noline) xsc(r(0(.2).4) nofextend) 
ytitle("") xlab(0(.2).4, labsize(small)) xtitle("Shift in support", size(small)) 
yline(6, lcolor(gray) lpattern(dash)) ylab(none) xline(0, lcolor(gray) lpattern(dot)) 
title("Relationship with PID" "(shift from weak Rep to weak Dem)", size(small)) 
fxsize(27) ysize(6) name(pid7catd, replace)  
;
#delimit cr

graph combine policy_means disgust pid7catd, row(1)
graph export Figure5.tif, width(1200) height(800) replace

restore 

**#
*******************************************************************************
**********FIGURE 6**********
use Body_Politic_All_datasets, clear
gen disgustpid7catdR = disgust*pid7catdR
svyset [pweight=weight]
foreach var of varlist index_concern_1 index_concern_2 index_concern_3 index_pers_1 index_pers_2r index_return_1  index_discomfort index_return_3 index_pol_1 index_pol_2 index_pol_3  {
svy: reg `var' disgustpid7catdR disgust pid7catdR ideol female black hisp othrace age01 
est store `var'
}

*pull means per wave 
svyset [iweight=weight]
forval j =1(1)5 {
	gen dataset_`j'=0
	replace dataset_`j' = 1 if dataset==`j'
}

forval j =1/5 {
	svy, subpop(dataset_`j'): mean disgust pid7catdR ideol female black hisp othrace age01 
	matrix `v'_`j'mean = r(mean)
	svmat `v'_`j'mean, name(`v'_`j'mean)
	} 

//generate predicted values in simulated datasets 
collapse pid7catdR ideol female black hisp othrace age01 
expand 11
egen disgust = fill(0(.1)1)
expand 2
replace pid7catdR = 0 in 1/11
replace pid7catdR = 1 in 12/22
gen disgustpid7catdR = disgust*pid7catdR

foreach v in index_concern_1 index_concern_2 index_concern_3 index_pers_1 index_pers_2r index_return_1  index_discomfort index_return_3 index_pol_1 index_pol_2 index_pol_3  {
est restore `v' 
predict `v'hat
predict `v'stdp, stdp
gen lb`v' = `v'hat - 1.96*`v'stdp
gen ub`v' = `v'hat + 1.96*`v'stdp
}
//values for 25-75 percentile on disgust//
//April 2020: .37 - .6875
//July 2020: .3125 - .6875
//Fall 2020: .3125 - .625
//June 2022: .3125 - .625 

twoway  (rarea lbindex_concern_1  ubindex_concern_1 disgust if pid7catdR==0, lcolor(red*.25%10) fcolor(red%25) fintensity(25) msymbol(i))  (connected index_concern_1hat  disgust if pid7catdR==0, lcolor(red%50) msymbol(i) lpattern(solid)) (rarea lbindex_concern_1   ubindex_concern_1 disgust if pid7catdR==1, lcolor(blue*.25%10) fcolor(blue%25) fintensity(25) msymbol(i) lpattern(solid)) (connected index_concern_1hat disgust if pid7catdR==1, lcolor(blue%50) msymbol(i) lpattern(solid)) , title("COVID concern index""April 2020") xtitle("Disgust sensitivity") ytitle("Predicted value") xlab(0 "Min" .37 "25%" .6875 "75%" 1 "Max") legend(off) name(index_concern_1hat, replace) text(.9 0 "Democrats", color(blue) place(e)) text(.6 0 "Republicans", color(red) place(e)) ylab(,angle(0)) plotr(ls(none)) ysc(nofextend) xsc(nofextend)

twoway  (rarea lbindex_concern_2 ubindex_concern_2 disgust if pid7catdR==0, lcolor(red*.25%10) fcolor(red%25) fintensity(25) msymbol(i))  (connected index_concern_2hat  disgust if pid7catdR==0, lcolor(red%50) msymbol(i) lpattern(solid)) (rarea lbindex_concern_2   ubindex_concern_2 disgust if pid7catdR==1, lcolor(blue*.25%10) fcolor(blue%25) fintensity(25) msymbol(i) lpattern(solid)) (connected index_concern_2hat disgust if pid7catdR==1, lcolor(blue%50) msymbol(i) lpattern(solid)) , title("COVID concern index""July 2020") xtitle("Disgust sensitivity") ytitle("Predicted value") xlab(0 "Min" .3125 "25%" .6875 "75%" 1 "Max") legend(off) name(index_concern_2hat, replace) ylab(,angle(0)) plotr(ls(none)) ysc(nofextend) xsc(nofextend)

twoway  (rarea lbindex_concern_3 ubindex_concern_3 disgust if pid7catdR==0, lcolor(red*.25%10) fcolor(red%25) fintensity(25) msymbol(i))  (connected index_concern_3hat  disgust if pid7catdR==0, lcolor(red%50) msymbol(i) lpattern(solid)) (rarea lbindex_concern_3   ubindex_concern_3 disgust if pid7catdR==1, lcolor(blue*.25%10) fcolor(blue%25) fintensity(25) msymbol(i) lpattern(solid)) (connected index_concern_3hat disgust if pid7catdR==1, lcolor(blue%50) msymbol(i) lpattern(solid)) , title("COVID concern index""June 2022") xtitle("Disgust sensitivity") ytitle("Predicted value") xlab(0 "Min" .3125 "25%" .625 "75%" 1 "Max") legend(off) name(index_concern_3hat, replace) ylab(,angle(0)) plotr(ls(none)) ysc(nofextend) xsc(nofextend)

twoway  (rarea lbindex_pers_1  ubindex_pers_1 disgust if pid7catdR==0, lcolor(red*.25%10) fcolor(red%25) fintensity(25) msymbol(i))  (connected index_pers_1hat disgust if pid7catdR==0, lcolor(red%50) msymbol(i) lpattern(solid)) (rarea lbindex_pers_1 ubindex_pers_1 disgust if pid7catdR==1, lcolor(blue*.25%10) fcolor(blue%25) fintensity(25) msymbol(i) lpattern(solid)) (connected index_pers_1hat disgust if pid7catdR==1, lcolor(blue%50) msymbol(i) lpattern(solid)) , title("Personal behaviors index""April 2020") xtitle("Disgust sensitivity") ytitle("Predicted value") xlab(0 "Min" .37 "25%" .6875 "75%" 1 "Max") legend(off) name(index_pers_1hat, replace) ylab(,angle(0)) plotr(ls(none)) ysc(nofextend) xsc(nofextend)

twoway  (rarea lbindex_pers_1  ubindex_pers_1 disgust if pid7catdR==0, lcolor(red*.25%10) fcolor(red%25) fintensity(25) msymbol(i))  (connected index_pers_1hat disgust if pid7catdR==0, lcolor(red%50) msymbol(i) lpattern(solid)) (rarea lbindex_pers_1 ubindex_pers_1 disgust if pid7catdR==1, lcolor(blue*.25%10) fcolor(blue%25) fintensity(25) msymbol(i) lpattern(solid)) (connected index_pers_1hat disgust if pid7catdR==1, lcolor(blue%50) msymbol(i) lpattern(solid)) , title("Personal behaviors index""April 2020") xtitle("Disgust sensitivity") ytitle("Predicted value") xlab(0 "Min" .37 "25%" .6875 "75%" 1 "Max") legend(off) name(index_pers_1hat, replace) ylab(,angle(0)) plotr(ls(none)) ysc(nofextend) xsc(nofextend)

twoway  (rarea lbindex_pers_2 ubindex_pers_2 disgust if pid7catdR==0, lcolor(red*.25%10) fcolor(red%25) fintensity(25) msymbol(i))  (connected index_pers_2rhat disgust if pid7catdR==0, lcolor(red%50) msymbol(i) lpattern(solid)) (rarea lbindex_pers_2 ubindex_pers_2 disgust if pid7catdR==1, lcolor(blue*.25%10) fcolor(blue%25) fintensity(25) msymbol(i) lpattern(solid)) (connected index_pers_2rhat disgust if pid7catdR==1, lcolor(blue%50) msymbol(i) lpattern(solid)), title("Personal behaviors index""July 2020") xtitle("Disgust sensitivity") ytitle("Predicted value") xlab(0 "Min" .3125 "25%" .6875 "75%" 1 "Max") legend(off) name(index_pers_2rhat, replace) ylab(,angle(0)) plotr(ls(none)) ysc(nofextend) xsc(nofextend)

twoway  (rarea lbindex_return_1 ubindex_return_1 disgust if pid7catdR==0, lcolor(red*.25%10) fcolor(red%25) fintensity(25) msymbol(i))  (connected index_return_1hat disgust if pid7catdR==0, lcolor(red%50) msymbol(i) lpattern(solid)) (rarea lbindex_return_1 ubindex_return_1 disgust if pid7catdR==1, lcolor(blue*.25%10) fcolor(blue%25) fintensity(25) msymbol(i) lpattern(solid)) (connected index_return_1hat disgust if pid7catdR==1, lcolor(blue%50) msymbol(i) lpattern(solid)), title("Return to activities index""April 2020") xtitle("Disgust sensitivity") ytitle("Predicted value") xlab(0 "Min" .37 "25%" .6875 "75%" 1 "Max") legend(off) name(index_return_1hat, replace) ylab(,angle(0)) plotr(ls(none)) ysc(nofextend) xsc(nofextend)

twoway  (rarea lbindex_return_3 ubindex_return_3 disgust if pid7catdR==0, lcolor(red*.25%10) fcolor(red%25) fintensity(25) msymbol(i))  (connected index_return_3hat disgust if pid7catdR==0, lcolor(red%50) msymbol(i) lpattern(solid)) (rarea lbindex_return_3 ubindex_return_3 disgust if pid7catdR==1, lcolor(blue*.25%10) fcolor(blue%25) fintensity(25) msymbol(i) lpattern(solid)) (connected index_return_3hat disgust if pid7catdR==1, lcolor(blue%50) msymbol(i) lpattern(solid)), title("Return to activities index""June 2022") xtitle("Disgust sensitivity") ytitle("Predicted value") xlab(0 "Min" .3125 "25%" .625 "75%" 1 "Max") legend(off) name(index_return_3hat, replace) ylab(,angle(0)) plotr(ls(none)) ysc(nofextend) xsc(nofextend)

twoway  (rarea lbindex_discomfort ubindex_discomfort disgust if pid7catdR==0, lcolor(red*.25%10) fcolor(red%25) fintensity(25) msymbol(i))  (connected index_discomforthat disgust if pid7catdR==0, lcolor(red%50) msymbol(i) lpattern(solid)) (rarea lbindex_discomfort ubindex_discomfort disgust if pid7catdR==1, lcolor(blue*.25%10) fcolor(blue%25) fintensity(25) msymbol(i) lpattern(solid)) (connected index_discomforthat disgust if pid7catdR==1, lcolor(blue%50) msymbol(i) lpattern(solid)), title("Discomfort with activities index""Fall 2020") xtitle("Disgust sensitivity") ytitle("Predicted value") xlab(0 "Min" .3125 "25%" .625 "75%" 1 "Max") legend(off) name(index_discomforthat, replace)  ylab(,angle(0)) plotr(ls(none)) ysc(nofextend) xsc(nofextend)

twoway  (rarea lbindex_pol_1 ubindex_pol_1 disgust if pid7catdR==0, lcolor(red*.25%10) fcolor(red%25) fintensity(25) msymbol(i))  (connected index_pol_1hat disgust if pid7catdR==0, lcolor(red%50) msymbol(i) lpattern(solid)) (rarea lbindex_pol_1 ubindex_pol_1 disgust if pid7catdR==1, lcolor(blue*.25%10) fcolor(blue%25) fintensity(25) msymbol(i) lpattern(solid)) (connected index_pol_1hat disgust if pid7catdR==1, lcolor(blue%50) msymbol(i) lpattern(solid)), title("Policies index""April 2020") xtitle("Disgust sensitivity") ytitle("Predicted value") xlab(0 "Min" .37 "25%" .6875 "75%" 1 "Max") legend(off) name(index_pol_1hat, replace) ylab(,angle(0)) plotr(ls(none)) ysc(nofextend) xsc(nofextend)

twoway  (rarea lbindex_pol_2 ubindex_pol_2 disgust if pid7catdR==0, lcolor(red*.25%10) fcolor(red%25) fintensity(25) msymbol(i))  (connected index_pol_2hat disgust if pid7catdR==0, lcolor(red%50) msymbol(i) lpattern(solid)) (rarea lbindex_pol_2 ubindex_pol_2 disgust if pid7catdR==1, lcolor(blue*.25%10) fcolor(blue%25) fintensity(25) msymbol(i) lpattern(solid)) (connected index_pol_2hat disgust if pid7catdR==1, lcolor(blue%50) msymbol(i) lpattern(solid)), title("Policies index""July 2020") xtitle("Disgust sensitivity") ytitle("Predicted value") xlab(0 "Min" .3125 "25%" .6875 "75%" 1 "Max") legend(off) name(index_pol_2hat , replace) ylab(,angle(0)) plotr(ls(none)) ysc(nofextend) xsc(nofextend)

twoway  (rarea lbindex_pol_3 ubindex_pol_3 disgust if pid7catdR==0, lcolor(red*.25%10) fcolor(red%25) fintensity(25) msymbol(i))  (connected index_pol_3hat disgust if pid7catdR==0, lcolor(red%50) msymbol(i) lpattern(solid)) (rarea lbindex_pol_3 ubindex_pol_3 disgust if pid7catdR==1, lcolor(blue*.25%10) fcolor(blue%25) fintensity(25) msymbol(i) lpattern(solid)) (connected index_pol_3hat disgust if pid7catdR==1, lcolor(blue%50) msymbol(i) lpattern(solid)), title("Policies index""June 2022") xtitle("Disgust sensitivity") ytitle("Predicted value") xlab(0 "Min" .3125 "25%" .62 "75%" 1 "Max") legend(off) name(index_pol_3hat, replace) ylab(,angle(0)) plotr(ls(none)) ysc(nofextend) xsc(nofextend)

graph combine index_concern_1hat index_concern_2hat index_concern_3hat  index_pers_1hat index_pers_2rhat index_return_1hat index_discomforthat index_return_3hat index_pol_1hat index_pol_2hat index_pol_3hat, hole(6) row(4) altshrink  ysize(8) xsize(6.5) ycommon

graph export Figure6.tif, width(650) height(800) replace

*****tidying up directory*****
foreach v in ebola_concern zika_concern concern_live_1 concern_live_2 concern_live_3 ebola_US zika_US protectAmer_1 protectAmer_2 protectAmer_3 ebola_AF zika_LA fightabroad_1 fightabroad_2 fightabroad_3 ebola_UScit zika_UScit prevent_UScit_1 prevent_UScit_2 prevent_UScit_3 ebola_forcit zika_forcit prevent_forcit_1 prevent_forcit_2 prevent_forcit_3 {
	erase `v'categories.dta
}
foreach v in allEZC_coeffs C19_persbeh_means C19_persbeh_coeffs C19_reluctance_means C19_reluctance_coeffs C19_policy_means C19_policy_coeffs {
	erase `v'.dta
}
*****tidying up directory*****

log close
